import request from '@/utils/axios';
import Course from '@/api/module/course'

interface IResponseType<P = {}> {
    code?: number;
    msg: string;
    data: P;
}

// @ts-ignore
export const page = (course : Course)=>{
    return request<IResponseType>({
        url: '/courseManage/getCoursePage',
        method: 'post',
        data: course
    });
}
export const detailCourse = (courseId : number)=>{
    return request<IResponseType>({
        url: '/courseManage/getCourseDetail',
        method: 'get',
        params: { courseId : courseId}
    });
}
export const study = (courseId : number)=>{
    return request<IResponseType>({
        url: '/myCourse/study',
        method: 'post',
        params: { courseId : courseId}
    });
}
export default { page,detailCourse,study };